In Module A I have two link modules associated. One link module that 'Satisfies' requirements from another module and another module 'LinksAsOneRequirement' that links multiple objects within Module A for a complete requirement. I did this mainly to reference OLE tables since multiple requirements could potentially reference the same table. Discussing further about 'LinksAsOneRequirement', for example I made a start link from an object and created links to all the OLE tables that it references.
// DXL generated by DOORS traceability wizard on 05 November 2010.
// Wizard version 2.0, DOORS version 9.3.0.0
pragma runLim, 0
int lines[2] = {0, 0}
void adjustLines(int depth, showAtDepth) {
int count
for (count = 0; count < 2; count++) {
while (lines[depth-1] < lines[count]) {
if (depth == showAtDepth) displayRich("\\pard " " ")
lines[depth-1]++
}
}
}
void showIn(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for lr in all(o<-linkModName) do {
otherMod = module (sourceVersion lr)
if (!null otherMod) {
if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
load((sourceVersion lr),false)
}
}
}
for l in all(o<-linkModName) do {
otherVersion = sourceVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
othero = source l
if (null othero) {
load(otherVersion,false)
}
othero = source l
if (null othero) continue
if (isDeleted othero) continue
int oldLines = lines[depth-1]
adjustLines(depth, 1)
bool kick = (doneOne) && (lines[depth-1] == oldLines)
if (kick) {
lines[depth-1]++
if (depth == 1) displayRich("\\pard " " ")
}
if (depth < 2) {
showIn(othero, depth+1)
}
doneOne = true
if (depth == 1) {
s = probeRichAttr_(othero,"Object Text", false)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
lines[depth-1] += 1
}
if (depth == 1) {
ExternalLink extLink
doneOne = false
for extLink in o<-"" do {
if (!doneOne) {
displayRich("\\pard " "{\\b External Links:}")
doneOne = true
}
s = richText description(extLink)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
}
}
showIn(obj,1)
lsand - Fri Nov 12 14:28:55 EST 2010 |
Re: Modifying the DXL Wizard code for Traceability if (!TextDumped) displayRich(probeRichAttr_(othero,"Object Text", false) "\\pard ") TextDumped = true
May need an additional space after the \\pard. |
Re: Modifying the DXL Wizard code for Traceability llandale - Mon Nov 15 15:14:28 EST 2010
May need an additional space after the \\pard.
I've created a function that will go through a specific link module for an object o and concatenate the parent and each child requirement into one requirement text. I verified that the code is returning the correct concatenated complete requirement ..but when I put it into the Wizard's code I get a blank out of it:
void DisplayWholeSystemRequirement(Object o, string linkModName)
{
Link currLink;
string completeReq = null;
string parentReq = null;
string childReq = null;
int numChild = 0;
//go through every link
for currLink in obj->linkModName do
{
Object tarObj = target currLink;
Object sourceObj = source currLink;
Module m;
if (null tarObj)
{
//m = read(mn, false);
tarObj = target currLink;
sourceObj = source currLink;
}
if( numChild == 0 )
{
parentReq = richTextWithOle(sourceObj."Object Text");
childReq = richTextWithOle(tarObj."Object Text");
completeReq = parentReq "\\par " childReq
}
else
{
// set the combined string to what it was plus a new line,
//then the new child text
childReq = richTextWithOle(tarObj."Object Text");
completeReq = completeReq "\\par " childReq
}
numChild ++
}
displayRich completeReq;
}
// DXL generated by DOORS traceability wizard on 05 November 2010.
// Wizard version 2.0, DOORS version 9.3.0.0
pragma runLim, 0
#include <layout/show.inc>
#include "addins//extensions//EPSAttributesAndModules.inc"
#include "addins//extensions//EPSCommonFunctions.inc"
int lines[2] = {0, 0}
void adjustLines(int depth, showAtDepth) {
int count
for (count = 0; count < 2; count++) {
while (lines[depth-1] < lines[count]) {
if (depth == showAtDepth) displayRich("\\pard " " ")
lines[depth-1]++
}
}
}
void showIn(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for lr in all(o<-linkModName) do {
otherMod = module (sourceVersion lr)
if (!null otherMod) {
if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
load((sourceVersion lr),false)
}
}
}
for l in all(o<-linkModName) do {
otherVersion = sourceVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
othero = source l
if (null othero) {
load(otherVersion,false)
}
othero = source l
if (null othero) continue
if (isDeleted othero) continue
int oldLines = lines[depth-1]
adjustLines(depth, 1)
bool kick = (doneOne) && (lines[depth-1] == oldLines)
if (kick) {
lines[depth-1]++
if (depth == 1) displayRich("\\pard " " ")
}
if (depth < 2) {
showIn(othero, depth+1)
}
doneOne = true
if (depth == 1)
{
DisplayWholeSystemRequirement(othero, _LINKS_AS_ONE_REQUIREMENT); //BLANK?
//s = probeRichAttr_(othero,"Object Text", false)
//if (s == "")
//displayRich("\\pard " " ")
//else
//displayRich("\\pard " completeRequirement)
}
lines[depth-1] += 1
}
if (depth == 1) {
ExternalLink extLink
doneOne = false
for extLink in o<-"" do {
if (!doneOne) {
displayRich("\\pard " "{\\b External Links:}")
doneOne = true
}
s = richText description(extLink)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
}
}
showIn(obj,1)
|
Re: Modifying the DXL Wizard code for Traceability lsand - Mon Nov 15 18:03:05 EST 2010
I've created a function that will go through a specific link module for an object o and concatenate the parent and each child requirement into one requirement text. I verified that the code is returning the correct concatenated complete requirement ..but when I put it into the Wizard's code I get a blank out of it:
void DisplayWholeSystemRequirement(Object o, string linkModName)
{
Link currLink;
string completeReq = null;
string parentReq = null;
string childReq = null;
int numChild = 0;
//go through every link
for currLink in obj->linkModName do
{
Object tarObj = target currLink;
Object sourceObj = source currLink;
Module m;
if (null tarObj)
{
//m = read(mn, false);
tarObj = target currLink;
sourceObj = source currLink;
}
if( numChild == 0 )
{
parentReq = richTextWithOle(sourceObj."Object Text");
childReq = richTextWithOle(tarObj."Object Text");
completeReq = parentReq "\\par " childReq
}
else
{
// set the combined string to what it was plus a new line,
//then the new child text
childReq = richTextWithOle(tarObj."Object Text");
completeReq = completeReq "\\par " childReq
}
numChild ++
}
displayRich completeReq;
}
// DXL generated by DOORS traceability wizard on 05 November 2010.
// Wizard version 2.0, DOORS version 9.3.0.0
pragma runLim, 0
#include <layout/show.inc>
#include "addins//extensions//EPSAttributesAndModules.inc"
#include "addins//extensions//EPSCommonFunctions.inc"
int lines[2] = {0, 0}
void adjustLines(int depth, showAtDepth) {
int count
for (count = 0; count < 2; count++) {
while (lines[depth-1] < lines[count]) {
if (depth == showAtDepth) displayRich("\\pard " " ")
lines[depth-1]++
}
}
}
void showIn(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for lr in all(o<-linkModName) do {
otherMod = module (sourceVersion lr)
if (!null otherMod) {
if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
load((sourceVersion lr),false)
}
}
}
for l in all(o<-linkModName) do {
otherVersion = sourceVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
othero = source l
if (null othero) {
load(otherVersion,false)
}
othero = source l
if (null othero) continue
if (isDeleted othero) continue
int oldLines = lines[depth-1]
adjustLines(depth, 1)
bool kick = (doneOne) && (lines[depth-1] == oldLines)
if (kick) {
lines[depth-1]++
if (depth == 1) displayRich("\\pard " " ")
}
if (depth < 2) {
showIn(othero, depth+1)
}
doneOne = true
if (depth == 1)
{
DisplayWholeSystemRequirement(othero, _LINKS_AS_ONE_REQUIREMENT); //BLANK?
//s = probeRichAttr_(othero,"Object Text", false)
//if (s == "")
//displayRich("\\pard " " ")
//else
//displayRich("\\pard " completeRequirement)
}
lines[depth-1] += 1
}
if (depth == 1) {
ExternalLink extLink
doneOne = false
for extLink in o<-"" do {
if (!doneOne) {
displayRich("\\pard " "{\\b External Links:}")
doneOne = true
}
s = richText description(extLink)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
}
}
showIn(obj,1)
and a correction: DisplayWholeSystemRequirement(Object o, string linkModName)
DisplayWholeSystemRequirement(Object obj, string linkModName)
|
Re: Modifying the DXL Wizard code for Traceability lsand - Mon Nov 15 18:03:05 EST 2010
I've created a function that will go through a specific link module for an object o and concatenate the parent and each child requirement into one requirement text. I verified that the code is returning the correct concatenated complete requirement ..but when I put it into the Wizard's code I get a blank out of it:
void DisplayWholeSystemRequirement(Object o, string linkModName)
{
Link currLink;
string completeReq = null;
string parentReq = null;
string childReq = null;
int numChild = 0;
//go through every link
for currLink in obj->linkModName do
{
Object tarObj = target currLink;
Object sourceObj = source currLink;
Module m;
if (null tarObj)
{
//m = read(mn, false);
tarObj = target currLink;
sourceObj = source currLink;
}
if( numChild == 0 )
{
parentReq = richTextWithOle(sourceObj."Object Text");
childReq = richTextWithOle(tarObj."Object Text");
completeReq = parentReq "\\par " childReq
}
else
{
// set the combined string to what it was plus a new line,
//then the new child text
childReq = richTextWithOle(tarObj."Object Text");
completeReq = completeReq "\\par " childReq
}
numChild ++
}
displayRich completeReq;
}
// DXL generated by DOORS traceability wizard on 05 November 2010.
// Wizard version 2.0, DOORS version 9.3.0.0
pragma runLim, 0
#include <layout/show.inc>
#include "addins//extensions//EPSAttributesAndModules.inc"
#include "addins//extensions//EPSCommonFunctions.inc"
int lines[2] = {0, 0}
void adjustLines(int depth, showAtDepth) {
int count
for (count = 0; count < 2; count++) {
while (lines[depth-1] < lines[count]) {
if (depth == showAtDepth) displayRich("\\pard " " ")
lines[depth-1]++
}
}
}
void showIn(Object o, int depth) {
Link l
LinkRef lr
ModName_ otherMod = null
Module linkMod = null
ModuleVersion otherVersion = null
Object othero
string disp = null
string s = null
string plain, plainDisp
int plainTextLen
int count
bool doneOne = false
string linkModName = "*"
for lr in all(o<-linkModName) do {
otherMod = module (sourceVersion lr)
if (!null otherMod) {
if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
load((sourceVersion lr),false)
}
}
}
for l in all(o<-linkModName) do {
otherVersion = sourceVersion l
otherMod = module(otherVersion)
if (null otherMod || isDeleted otherMod) continue
othero = source l
if (null othero) {
load(otherVersion,false)
}
othero = source l
if (null othero) continue
if (isDeleted othero) continue
int oldLines = lines[depth-1]
adjustLines(depth, 1)
bool kick = (doneOne) && (lines[depth-1] == oldLines)
if (kick) {
lines[depth-1]++
if (depth == 1) displayRich("\\pard " " ")
}
if (depth < 2) {
showIn(othero, depth+1)
}
doneOne = true
if (depth == 1)
{
DisplayWholeSystemRequirement(othero, _LINKS_AS_ONE_REQUIREMENT); //BLANK?
//s = probeRichAttr_(othero,"Object Text", false)
//if (s == "")
//displayRich("\\pard " " ")
//else
//displayRich("\\pard " completeRequirement)
}
lines[depth-1] += 1
}
if (depth == 1) {
ExternalLink extLink
doneOne = false
for extLink in o<-"" do {
if (!doneOne) {
displayRich("\\pard " "{\\b External Links:}")
doneOne = true
}
s = richText description(extLink)
if (s == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " s)
}
}
}
showIn(obj,1)
Maybe you should not use "obj" in your function but "o" (the parameter):
void DisplayWholeSystemRequirement(Object o, string linkModName)
{ ...
for currLink in obj->linkModName do // really? obj?
...
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Modifying the DXL Wizard code for Traceability Mathias Mamsch - Tue Nov 16 04:14:09 EST 2010
Maybe you should not use "obj" in your function but "o" (the parameter):
void DisplayWholeSystemRequirement(Object o, string linkModName)
{ ...
for currLink in obj->linkModName do // really? obj?
...
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I added the following at the end of the function DisplayWholeSystemRequirement and I no longer get a blank output!
if (completeReq == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " completeReq)
|
Re: Modifying the DXL Wizard code for Traceability lsand - Tue Nov 16 13:18:49 EST 2010
I added the following at the end of the function DisplayWholeSystemRequirement and I no longer get a blank output!
if (completeReq == "")
displayRich("\\pard " " ")
else
displayRich("\\pard " completeReq)
Fixed the obj to o. Thought my problem was fixed but spoke too soon.
string testString = "Not Set"
for l in all(o<-"Satisfies") do
{
Object sourceOBj = source l
//not sure if this is needed but set the current folder
//to the same directory that the "LinksAs" module is in
for every l in all(sourceOBj -> "LinksAs") do
{
//If there exists an outgoing link, this means that the requiremnts are broken up
//Never gets here not sure why.
testString = "Set!!!"
}
}
display testString //outputs "Not Set"
|
Re: Modifying the DXL Wizard code for Traceability lsand - Wed Nov 17 18:28:13 EST 2010
Fixed the obj to o. Thought my problem was fixed but spoke too soon.
string testString = "Not Set"
for l in all(o<-"Satisfies") do
{
Object sourceOBj = source l
//not sure if this is needed but set the current folder
//to the same directory that the "LinksAs" module is in
for every l in all(sourceOBj -> "LinksAs") do
{
//If there exists an outgoing link, this means that the requiremnts are broken up
//Never gets here not sure why.
testString = "Set!!!"
}
}
display testString //outputs "Not Set"
Fixed the obj to o. Thought my problem was fixed but spoke too soon.
string testString = "Not Set"
for l in all(o<-"Satisfies") do
{
Object sourceOBj = source l
//not sure if this is needed but set the current folder
//to the same directory that the "LinksAs" module is in
for every l in all(sourceOBj -> "LinksAs") do
{
//If there exists an outgoing link, this means that the requiremnts are broken up
//into different objects and this for loop with concatenate the objects into one
//Never gets here not sure why.
testString = "Set!!!"
}
}
display testString //outputs "Not Set"
|
Re: Modifying the DXL Wizard code for Traceability lsand - Wed Nov 17 18:29:45 EST 2010
Fixed the obj to o. Thought my problem was fixed but spoke too soon.
string testString = "Not Set"
for l in all(o<-"Satisfies") do
{
Object sourceOBj = source l
//not sure if this is needed but set the current folder
//to the same directory that the "LinksAs" module is in
for every l in all(sourceOBj -> "LinksAs") do
{
//If there exists an outgoing link, this means that the requiremnts are broken up
//into different objects and this for loop with concatenate the objects into one
//Never gets here not sure why.
testString = "Set!!!"
}
}
display testString //outputs "Not Set"
|
Re: Modifying the DXL Wizard code for Traceability lsand - Wed Nov 17 18:38:27 EST 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Modifying the DXL Wizard code for Traceability Mathias Mamsch - Thu Nov 18 03:50:36 EST 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |